{% extends "head-footer.html" %}
{% load staticfiles %}

{% block middle %}

<aside class="main-sidebar">

    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
      <!-- search form (Optional) -->
      <form action="#" method="get" class="sidebar-form">
        <div class="input-group">
          <input type="text" name="q" class="form-control" placeholder="Search...">
              <span class="input-group-btn">
                <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
                </button>
              </span>
        </div>
      </form>
      <!-- /.search form -->

      <!-- Sidebar Menu -->
      <ul class="sidebar-menu">
        <li class="header">{{ request.user }}</li>
        <!-- Optionally, you can add icons to the links -->

      {% for menu in request.reveal_menu %}
        {% if not menu.url %}
        <li class="treeview" id="{{ menu.code }}">
          <a href=""><i class="{{ menu.icon }}"></i> <span>{{ menu.title }}</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            {% for sub in  menu.sub_menu %}
            <li id="{{ sub.code }}">
                <a href="{{ sub.url }}"><i class="fa fa-caret-right"></i>{{ sub.title }}</a></li>
            {% endfor %}
          </ul>
        </li>
        {% else %}
          <li id="{{ menu.code }}">
          <a href="{{ menu.url }}"><i class="{{ menu.icon }}"></i> <span>{{ menu.title }}</span>
          </a>
        </li>
        {% endif %}
      {% endfor %}

      </ul>
      <!-- /.sidebar-menu -->
    </section>
    <!-- /.sidebar -->
  </aside>


<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">

  {% block content %}


  {% endblock %}

</div>
<!-- /.content-wrapper -->

{% endblock %}